package com.glsc.ngateway.common.api.oaflow.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.glsc.ngateway.common.api.common.dto.BaseEntityDto;
import io.swagger.annotations.ApiModel;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author zhengyr
 * @date 2023/8/15-17:39
 */
@ToString(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel
@JsonInclude
@SuperBuilder
public class SystemFlowRelationResultDto extends BaseEntityDto implements Serializable {
    /**
     * 流程查询自用唯一id
     */
    private Integer flowId;
    /**
     * 流程类型中文名
     */
    @ExcelProperty(value = "流程类型", index = 1)
    private String processDefineKeyName;
    /**
     * 自研网关流程类型英文
     */
    private String processDefineKey;
    /**
     * 流程标题
     */
    @ExcelProperty(value = "流程标题", index = 2)
    private String processTitle;
    /**
     * 流程ID
     */
    @ExcelProperty(value = "流程ID", index = 3)
    private String processId;
    /**
     * 创建日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @ExcelProperty(value = "创建日期", index = 4)
    private LocalDateTime processCreateTime;

    /**
     * 发起人中文名
     */
    @ExcelProperty(value = "发起人", index = 5)
    private String flowCreateOperatorName;
    /**
     * 流程来源
     */
    private String flowFrom;
    /**
     * 嵌套格式
     */
    private List<SystemFlowRelationResultDto> children;

}
